package button
{
	import flash.events.Event;
	import flash.events.EventDispatcher;
	import flash.events.MouseEvent;
	
	import mx.controls.LinkButton;
	import mx.controls.listClasses.IListItemRenderer;
	import mx.core.IFactory;
	
	/**
	 * 需要实现IFactory类型
	 */
	public class EditButton extends EventDispatcher implements IFactory
	{
		[Embed("image/update.gif")]   
		private const linkButtonIcon:Class;   
		
		 public function EditButton(){  
            super();  
        }  
          
        public function newInstance():*{  
            //实例化渲染器，实现具体功能  
            var linkBtn:LinkButton = new LinkButton();
            linkBtn.toolTip = "删除";
            linkBtn.setStyle("icon", linkButtonIcon);
            linkBtn.addEventListener(MouseEvent.CLICK, clickHandle);
            return IListItemRenderer(linkBtn); 
        }
        
        private function clickHandle(event:MouseEvent):void
        {
        	this.dispatchEvent(new Event("edit_event"));
        }

	}
}